<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        h1{
            background-color: gray;
            font-family: fansong;
            display: flex;
            justify-content: right;
            max-width: 100%;
            align-content: center;
        }
        table{
            width: 100%;
            text-align: center;
            border-collapse: collapse;
        }
        thead{
            background-color:#f2f2f2 ;
        }
        th,td{
            border: 1px solid #ddd;
        }
    </style>
</head>
<body>
    <h1>学生管理系统</h1>
    <table>
        <thead>
            <th>编号</th>
            <th>用户名</th>
            <th>密码</th>
            <th>姓名</th>
            <th>年龄</th>
            <th>更新时间</th>
        </thead>
        <tbody id="aaa">
            <tr v-for="item in list">
                <td>{{item.id}}</td>
                <td>{{item.username}}</td>
                <td>{{item.password}}</td>
                <td>{{item.name}}</td>
                <td>{{item.age}}</td>
                <td>{{item.updateTime}}</td>
            </tr>
        </tbody>
        <script src="js/axios.min.js"></script>
        <script type="module">
                import { createApp } from './js/vue.esm-browser.js'
                createApp({
                  data(){
                    return{
                      list:[{"id":1,"username":"lisi","password":"000","name":"kdlj","age":122,"updateTime":"dsojjfk"}]
                    }
                  },
                  methods: {
                      async search(){
                          const result = await axios.get('/list');
                          this.list = result.data;
                      }
                  },
                  mounted() {
                    this.search();
                  }
                }).mount('#aaa')
        </script>
    </table>
</body>
</html>